# About

id3-unicodify fixes non-ASCII ID3 tags that where wrongly stored as Latin-1 by misconfigured software.

# Dependencies

It was tested against
    * Python 3.6 (on GNU/Linux)
    * `python3-mutagen` 1.39
    * `python3-beautifulsoup4` 4.6.0

# Usage

Run this script against a music file (`-f FILE`), or a directory (`-d DIR`) of music files (it will be scanned recursively). Optionally, aid encoding detection by passing suspected encodings with `-c CODEPAGE_1,CODEPAGE_2`. If the script is not called with `--dryrun`, changes will be written immediately to the files, so beware.

Arguments:

```
  -h, --help            show this help message and exit
  -d DIR, --dir DIR     Source directory path
  -f FILE, --file FILE  Source file
  -c CODEPAGE, --codepage CODEPAGE
                        Suspected encodings to aid detection. Comma-seperated
                        list.
  --dryrun              Do not actually write changes to file
```

# Caveats

Encoding detection is not 100% accurate. In my tests, it was reasonably accurate with up to two encodings mixed together in a music library. Always use `--dryrun` first to spot problems. Consider unicodifying stubborn files or directories individually with the correct `-codepage CODEPAGE` and then running the script against your whole music library.

The script is not optimised for performance yet. It might waste more CPU than needed. 